import { getReport } from '@/services/report';

export default {
  namespace: 'service',

  state: {
    ServiceData: {},
  },

  effects: {
    *getServiceData({ payload }, { call, put }) {
      const response = yield call(getReport, payload);
      yield put({
        type: 'setServiceData',
        payload: {
          ServiceData: response,
        },
      });
    },
  },
  reducers: {
    setServiceData(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
};
